/*
 * SNMPManagerView.java
 */

package snmpmanager;

import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import snmpmanager.src.SNMPManager;
import snmpmanager.src.SNMPTrama;

/**
 * The application's main frame.
 */
public class SNMPManagerView extends FrameView {
    SNMPManager snmpManager = new SNMPManager();
    SNMPTrama objTrama = new SNMPTrama();
    int opcion=13612111;
    public SNMPManagerView(SingleFrameApplication app) {
        super(app);

        initComponents();
        rbt13612111.setSelected(true);

        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName)) {
                    String text = (String)(evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer)(evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = SNMPManagerApp.getApplication().getMainFrame();
            aboutBox = new SNMPManagerAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        SNMPManagerApp.getApplication().show(aboutBox);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        rbt13612111 = new javax.swing.JRadioButton();
        rbt13612114 = new javax.swing.JRadioButton();
        rbt13612115 = new javax.swing.JRadioButton();
        rbt13612116 = new javax.swing.JRadioButton();
        rbt13612410 = new javax.swing.JRadioButton();
        rbt13612411 = new javax.swing.JRadioButton();
        rbt13612412 = new javax.swing.JRadioButton();
        rbt13612413 = new javax.swing.JRadioButton();
        rbt13612414 = new javax.swing.JRadioButton();
        rbt13612415 = new javax.swing.JRadioButton();
        rbt13612416 = new javax.swing.JRadioButton();
        rbt13612417 = new javax.swing.JRadioButton();
        rbt13612418 = new javax.swing.JRadioButton();
        jPanel2 = new javax.swing.JPanel();
        txtIP = new javax.swing.JTextField();
        txtComunidad = new javax.swing.JTextField();
        btnConsultar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        lblVersion = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        lblComunidad = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        lblOperacion = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        lblObjectId = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        lblDato = new javax.swing.JLabel();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();
        btnGrObjectID = new javax.swing.ButtonGroup();

        mainPanel.setName("mainPanel"); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel1.setName("jPanel1"); // NOI18N

        btnGrObjectID.add(rbt13612111);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(snmpmanager.SNMPManagerApp.class).getContext().getResourceMap(SNMPManagerView.class);
        rbt13612111.setText(resourceMap.getString("rbt13612111.text")); // NOI18N
        rbt13612111.setName("rbt13612111"); // NOI18N
        rbt13612111.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612111ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612114);
        rbt13612114.setText(resourceMap.getString("rbt13612114.text")); // NOI18N
        rbt13612114.setName("rbt13612114"); // NOI18N
        rbt13612114.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612114ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612115);
        rbt13612115.setText(resourceMap.getString("rbt13612115.text")); // NOI18N
        rbt13612115.setName("rbt13612115"); // NOI18N
        rbt13612115.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612115ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612116);
        rbt13612116.setText(resourceMap.getString("rbt13612116.text")); // NOI18N
        rbt13612116.setName("rbt13612116"); // NOI18N
        rbt13612116.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612116ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612410);
        rbt13612410.setText(resourceMap.getString("rbt13612410.text")); // NOI18N
        rbt13612410.setName("rbt13612410"); // NOI18N

        btnGrObjectID.add(rbt13612411);
        rbt13612411.setText(resourceMap.getString("rbt13612411.text")); // NOI18N
        rbt13612411.setName("rbt13612411"); // NOI18N
        rbt13612411.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612411ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612412);
        rbt13612412.setText(resourceMap.getString("rbt13612412.text")); // NOI18N
        rbt13612412.setName("rbt13612412"); // NOI18N
        rbt13612412.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612412ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612413);
        rbt13612413.setText(resourceMap.getString("rbt13612413.text")); // NOI18N
        rbt13612413.setName("rbt13612413"); // NOI18N
        rbt13612413.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612413ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612414);
        rbt13612414.setText(resourceMap.getString("rbt13612414.text")); // NOI18N
        rbt13612414.setName("rbt13612414"); // NOI18N
        rbt13612414.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612414ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612415);
        rbt13612415.setText(resourceMap.getString("rbt13612415.text")); // NOI18N
        rbt13612415.setName("rbt13612415"); // NOI18N
        rbt13612415.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612415ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612416);
        rbt13612416.setText(resourceMap.getString("rbt13612416.text")); // NOI18N
        rbt13612416.setName("rbt13612416"); // NOI18N
        rbt13612416.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612416ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612417);
        rbt13612417.setText(resourceMap.getString("rbt13612417.text")); // NOI18N
        rbt13612417.setName("rbt13612417"); // NOI18N
        rbt13612417.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612417ActionPerformed(evt);
            }
        });

        btnGrObjectID.add(rbt13612418);
        rbt13612418.setText(resourceMap.getString("rbt13612418.text")); // NOI18N
        rbt13612418.setName("rbt13612418"); // NOI18N
        rbt13612418.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbt13612418ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rbt13612111)
                    .addComponent(rbt13612114)
                    .addComponent(rbt13612115)
                    .addComponent(rbt13612116)
                    .addComponent(rbt13612410)
                    .addComponent(rbt13612411))
                .addGap(46, 46, 46)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(rbt13612418)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(rbt13612417, javax.swing.GroupLayout.DEFAULT_SIZE, 269, Short.MAX_VALUE)
                            .addContainerGap())
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(rbt13612416)
                            .addContainerGap())
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(rbt13612415)
                            .addContainerGap())
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(rbt13612414)
                            .addContainerGap())
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(rbt13612413)
                            .addContainerGap())
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(rbt13612412)
                            .addContainerGap()))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbt13612412)
                    .addComponent(rbt13612111))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbt13612413)
                    .addComponent(rbt13612114))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbt13612414)
                    .addComponent(rbt13612115))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbt13612415)
                    .addComponent(rbt13612116))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbt13612416)
                    .addComponent(rbt13612410))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbt13612417)
                    .addComponent(rbt13612411))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(rbt13612418)
                .addContainerGap(116, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setName("jPanel2"); // NOI18N

        txtIP.setText(resourceMap.getString("txtIP.text")); // NOI18N
        txtIP.setName("txtIP"); // NOI18N

        txtComunidad.setText(resourceMap.getString("txtComunidad.text")); // NOI18N
        txtComunidad.setName("txtComunidad"); // NOI18N

        btnConsultar.setText(resourceMap.getString("btnConsultar.text")); // NOI18N
        btnConsultar.setName("btnConsultar"); // NOI18N
        btnConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnConsultarActionPerformed(evt);
            }
        });

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtComunidad)
                    .addComponent(txtIP, javax.swing.GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE))
                .addGap(35, 35, 35)
                .addComponent(btnConsultar)
                .addGap(60, 60, 60))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(txtIP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtComunidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(btnConsultar)))
                .addContainerGap())
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel3.setName("jPanel3"); // NOI18N

        jLabel3.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N
        jLabel3.setText(resourceMap.getString("VERSION.text")); // NOI18N
        jLabel3.setName("VERSION"); // NOI18N

        lblVersion.setText(resourceMap.getString("lblVersion.text")); // NOI18N
        lblVersion.setName("lblVersion"); // NOI18N

        jLabel4.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N
        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        lblComunidad.setName("lblComunidad"); // NOI18N

        jLabel5.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N
        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        lblOperacion.setName("lblOperacion"); // NOI18N

        jLabel6.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N
        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        lblObjectId.setName("lblObjectId"); // NOI18N

        jLabel7.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N
        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        lblDato.setName("lblDato"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(lblComunidad, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE)
                    .addComponent(jLabel4)
                    .addComponent(lblOperacion, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE)
                    .addComponent(jLabel5)
                    .addComponent(lblObjectId, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE)
                    .addComponent(jLabel6)
                    .addComponent(lblDato, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE)
                    .addComponent(jLabel7)
                    .addComponent(lblVersion, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblVersion, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lblComunidad, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lblOperacion, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lblObjectId, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lblDato, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(94, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(8, 8, 8))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(snmpmanager.SNMPManagerApp.class).getContext().getActionMap(SNMPManagerView.class, this);
        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        statusPanel.setName("statusPanel"); // NOI18N

        statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        progressBar.setName("progressBar"); // NOI18N

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 463, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(statusMessageLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 307, Short.MAX_VALUE)
                        .addComponent(statusAnimationLabel)
                        .addGap(146, 146, 146)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(statusAnimationLabel))
                .addGap(3, 3, 3))
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void btnConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConsultarActionPerformed
        // TODO add your handling code here:
        String dato= new String();
        if(rbt13612111.isSelected()){
            opcion= 13612111;
        }else if(rbt13612114.isSelected()){
            opcion= 13612114;
        }
        else if(rbt13612115.isSelected()){
            opcion= 13612115;
        }
        else if(rbt13612116.isSelected()){
            opcion= 13612116;
        }
        else if(rbt13612410.isSelected()){
            opcion= 13612410;
        }
        else if(rbt13612411.isSelected()){
            opcion= 13612411;
        }
        else if(rbt13612412.isSelected()){
            opcion= 13612412;
        }
        else if(rbt13612413.isSelected()){
            opcion= 13612413;
        }
        else if(rbt13612414.isSelected()){
            opcion= 13612414;
        }
        else if(rbt13612415.isSelected()){
            opcion= 13612415;
        }
        else if(rbt13612416.isSelected()){
            opcion= 13612416;
        }
        else if(rbt13612417.isSelected()){
            opcion= 13612417;
        }
        else if(rbt13612418.isSelected()){
            opcion= 13612418;
        }
         try {
             objTrama = snmpManager.hacerConsulta(txtIP.getText(), txtComunidad.getText(), opcion);
            lblVersion.setText(Character.toString(objTrama.getVersion()));
            lblComunidad.setText(objTrama.getComunidad());
            lblOperacion.setText("0x" + Integer.toHexString(objTrama.getOperacion()));
            lblObjectId.setText(Integer.toString(objTrama.getId()));
            lblDato.setText(objTrama.getDato());
         }catch (Exception ex) {
            Logger.getLogger(SNMPManagerView.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnConsultarActionPerformed

    private void rbt13612111ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612111ActionPerformed
        // TODO add your handling code here:
        opcion=13612111;
    }//GEN-LAST:event_rbt13612111ActionPerformed

    private void rbt13612114ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612114ActionPerformed
        // TODO add your handling code here:
        opcion=13612114;
    }//GEN-LAST:event_rbt13612114ActionPerformed

    private void rbt13612115ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612115ActionPerformed
        // TODO add your handling code here:
        opcion=13612115;
    }//GEN-LAST:event_rbt13612115ActionPerformed

    private void rbt13612116ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612116ActionPerformed
        // TODO add your handling code here:
        opcion=13612116;
    }//GEN-LAST:event_rbt13612116ActionPerformed

    private void rbt13612411ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612411ActionPerformed
        // TODO add your handling code here:
        opcion=13612410;
    }//GEN-LAST:event_rbt13612411ActionPerformed

    private void rbt13612412ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612412ActionPerformed
        // TODO add your handling code here:
        opcion=13612412;
    }//GEN-LAST:event_rbt13612412ActionPerformed

    private void rbt13612413ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612413ActionPerformed
        // TODO add your handling code here:
        opcion=13612413;
    }//GEN-LAST:event_rbt13612413ActionPerformed

    private void rbt13612414ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612414ActionPerformed
        // TODO add your handling code here:
        opcion=13612414;
    }//GEN-LAST:event_rbt13612414ActionPerformed

    private void rbt13612415ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612415ActionPerformed
        // TODO add your handling code here:
        opcion=13612415;
    }//GEN-LAST:event_rbt13612415ActionPerformed

    private void rbt13612416ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612416ActionPerformed
        // TODO add your handling code here:
        opcion=13612416;
}//GEN-LAST:event_rbt13612416ActionPerformed

    private void rbt13612417ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612417ActionPerformed
        // TODO add your handling code here:
        opcion=13612417;
}//GEN-LAST:event_rbt13612417ActionPerformed

    private void rbt13612418ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbt13612418ActionPerformed
        // TODO add your handling code here:
        opcion=13612418;
}//GEN-LAST:event_rbt13612418ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnConsultar;
    private javax.swing.ButtonGroup btnGrObjectID;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JLabel lblComunidad;
    private javax.swing.JLabel lblDato;
    private javax.swing.JLabel lblObjectId;
    private javax.swing.JLabel lblOperacion;
    private javax.swing.JLabel lblVersion;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JRadioButton rbt13612111;
    private javax.swing.JRadioButton rbt13612114;
    private javax.swing.JRadioButton rbt13612115;
    private javax.swing.JRadioButton rbt13612116;
    private javax.swing.JRadioButton rbt13612410;
    private javax.swing.JRadioButton rbt13612411;
    private javax.swing.JRadioButton rbt13612412;
    private javax.swing.JRadioButton rbt13612413;
    private javax.swing.JRadioButton rbt13612414;
    private javax.swing.JRadioButton rbt13612415;
    private javax.swing.JRadioButton rbt13612416;
    private javax.swing.JRadioButton rbt13612417;
    private javax.swing.JRadioButton rbt13612418;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    private javax.swing.JTextField txtComunidad;
    private javax.swing.JTextField txtIP;
    // End of variables declaration//GEN-END:variables

    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;

    private JDialog aboutBox;
}
